﻿namespace RndMaterialDisposalService.Attrbutes
{
    /// <summary>
    /// 
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class NAutowiredAttribute : Attribute
    {
        /// <summary>
        /// 
        /// </summary>
        public Lifecycle Lifecycle { get; private set; }
        /// <summary>
        /// 
        /// </summary>
        public Type? InterfaceType { get; private set; }

        /// <summary>
        /// Lifecycle.Scoped
        /// </summary>
        public NAutowiredAttribute()
        {
            Lifecycle = Lifecycle.Scoped;
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="_lifecycle"></param>
        public NAutowiredAttribute(Lifecycle _lifecycle)
        {
            Lifecycle = _lifecycle;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="_lifecycle"></param>
        /// <param name="_interfaceType"></param>
        public NAutowiredAttribute(Lifecycle _lifecycle, Type _interfaceType)
        {
            Lifecycle = _lifecycle;
            InterfaceType = _interfaceType;
        }
    }
    /// <summary>
    /// 
    /// </summary>
    public enum Lifecycle
    {
        /// <summary>
        /// 
        /// </summary>
        Transient,
        /// <summary>
        /// 
        /// </summary>
        Singleton,
        /// <summary>
        /// 
        /// </summary>
        Scoped
    }
}
